Error on package.json conditional exports fallback lookups#62310
Error on package.json conditional exports fallback lookups#62310andrewbranch wants to merge 4 commits intomainfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR disables package.json conditional exports fallback lookups by modifying the module resolution logic to return immediately when a condition fails to resolve, preventing TypeScript from falling back to other conditions like 'types' when the primary condition ('import') doesn't find TypeScript declaration files.
Key changes:
- Modified module resolution logic to stop searching after first failed condition
- Updated test baselines to reflect the new resolution behavior where .mjs files are resolved directly instead of falling back to .d.ts files
- Removed outdated comments describing the previous fallback behavior
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/compiler/moduleNameResolver.ts | Added early return to prevent fallback condition searches |
| tests/cases/conformance/moduleResolution/conditionalExportsResolutionFallback.ts | Removed comment describing old fallback behavior |
| tests/baselines/reference/*.trace.json | Updated trace logs showing direct .mjs resolution instead of .d.ts fallback |
| tests/baselines/reference/*.errors.txt | Removed comments about fallback behavior from error baselines |
...aselines/reference/conditionalExportsResolutionFallback(moduleresolution=bundler).trace.json
Show resolved
Hide resolved
...selines/reference/conditionalExportsResolutionFallback(moduleresolution=nodenext).trace.json
Show resolved
Hide resolved
|
@typescript-bot test top800 |
|
@andrewbranch Here are the results of running the top 800 repos with tsc comparing Something interesting changed - please have a look. Details
|
|
@andrewbranch Here are some more interesting changes from running the top 800 repos suite Details
|
|
@andrewbranch Here are some more interesting changes from running the top 800 repos suite Details
|
|
@andrewbranch Here are some more interesting changes from running the top 800 repos suite Details
|
|
@andrewbranch Here are some more interesting changes from running the top 800 repos suite Details
|
|
@andrewbranch Here are some more interesting changes from running the top 800 repos suite Details
|
|
@andrewbranch Here are some more interesting changes from running the top 800 repos suite Details
|
|
@andrewbranch Here are some more interesting changes from running the top 800 repos suite Details
|
|
@andrewbranch Here are some more interesting changes from running the top 800 repos suite Details
|
|
@andrewbranch Here are some more interesting changes from running the top 800 repos suite Details
|
|
This may well be more breaky than it's worth. We might just be stuck with this :/ |
|
A huge number of these failures (all the React-related ones) are due to a propagation of an |
|
@typescript-bot test top800 |
|
@andrewbranch Here are the results of running the top 800 repos with tsc comparing Something interesting changed - please have a look. Details
|
|
@andrewbranch Here are some more interesting changes from running the top 800 repos suite Details
|
|
@andrewbranch Here are some more interesting changes from running the top 800 repos suite Details
|
|
@andrewbranch Here are some more interesting changes from running the top 800 repos suite Details
|
|
Broken libraries: [
"@adminjs/design-system",
"@aws-sdk/core",
"@crxjs/vite-plugin",
"@cucumber/cucumber",
"@essentials/request-timeout",
"@graphiql/react",
"@hocuspocus/common",
"@hocuspocus/provider",
"@jdeniau/immutable-devtools",
"@metamask/json-rpc-engine",
"@metamask/providers",
"@octokit/plugin-rest-endpoint-methods",
"@petamoriken/float16",
"@phosphor-icons/react",
"@primeuix/themes",
"@qwik.dev/core",
"@react-hook/window-size",
"@sentry/bundler-plugin-core",
"@sentry/esbuild-plugin",
"@sentry/vite-plugin",
"@sentry/webpack-plugin",
"@smithy/core",
"@trpc/client",
"@trpc/next",
"@trpc/react-query",
"@trpc/server",
"@unified-latex/unified-latex-types",
"@unified-latex/unified-latex-util-arguments",
"@unified-latex/unified-latex-util-parse",
"@unified-latex/unified-latex-util-to-string",
"@xata.io/client",
"async-mutex",
"azure-kusto-data",
"cborg",
"check-disk-space",
"class-variance-authority",
"colorette",
"conditional-type-checks",
"cva",
"deep-object-diff",
"fast-sort",
"fast-text-table",
"formdata-node",
"geist",
"goober",
"highlight.js",
"hookable",
"hpagent",
"jsonrepair",
"masonic",
"nanodelay",
"pg-protocol",
"react-intl-universal",
"skia-canvas",
"surrealdb",
"svgo",
"then-busboy",
"tiptap-extension-global-drag-handle",
"tiptap-markdown",
"ua-parser-js",
"unplugin",
"vite-plugin-compression",
"web-tree-sitter",
"webamp",
"webdav",
"y-webrtc",
"y-websocket",
"zod-form-data"
]These have been fixed in |
|
tough :/ would be nice if we could have the fallback behavior that matches the spec |
Fixes #50762